package cn.itsource.zcn.pay.service.impl;

import cn.itsource.zcn.pay.domain.PayBill;
import cn.itsource.zcn.pay.mapper.PayBillMapper;
import cn.itsource.zcn.pay.service.IPayBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


import java.util.List;

/**
 * 支付单(PayBill)表服务实现类
 *
 * @author makejava
 * @since 2021-08-26 17:56:05
 */
@Service
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class PayBillServiceImpl implements IPayBillService {
    @Autowired
    private PayBillMapper tPayBillMapper;


    /**
     * 新增数据
     *
     * @param tPayBill 实例对象
     */
    @Override
    @Transactional
    public void save(PayBill tPayBill) {
        tPayBillMapper.save(tPayBill);
    }

    /**
     * 修改数据
     *
     * @param tPayBill 实例对象
     */
    @Override
    @Transactional
    public void update(PayBill tPayBill) {
        tPayBillMapper.update(tPayBill);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     */
    @Override
    @Transactional
    public void delete(Long id) {
        tPayBillMapper.delete(id);
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public PayBill queryById(Long id) {
        return tPayBillMapper.queryById(id);
    }

    /**
     * 查询多条数据
     *
     * @return 对象列表
     */
    @Override
    public List<PayBill> queryAll() {
        return tPayBillMapper.queryAll();
    }


}
